#ifndef __THREAD_H_
#define __THREAD_H_
#include "KLib.h"
#include "Task.h"
#include "NonCopyable.h"
#include "Event.h"
SK

typedef u32 (__stdcall *THREAD_START_PROC)(void *param);

class Thread : public NonCopyable
{
protected:
    Task *tsk;
	u32 state;
    HANDLE th;
    Event *completeEvent;
    void _runTask (void);
public:
    Thread (Event *completeEvent);
    Thread (THREAD_START_PROC proc, void *param);
    virtual ~Thread ();

    u32 getState (void);
    bool isRunning (void);

    virtual void start (Task *task);
	virtual void terminate (void);
	virtual void suspend (void);
	virtual void resume (void);

    static DWORD _threadStart(void* param);
    
};

EK

#endif